package com.xfhy.selectcity.data;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

/**
 * @author : xfhy
 * Create time : 2021/2/25 10:27
 * Description :
 */
@Entity(tableName = "city")
public class Area {

    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "id")
    private int mId;

    @NonNull
    @ColumnInfo(name = "code")
    private String mCode;

    @NonNull
    @ColumnInfo(name = "province")
    private String mProvince;

    @NonNull
    @ColumnInfo(name = "city")
    private String mCity;

    @NonNull
    @ColumnInfo(name = "country")
    private String mCountry;

    @NonNull
    @ColumnInfo(name = "fullpinyin")
    private String mFullPinYin;

    @NonNull
    @ColumnInfo(name = "shortpinyin")
    private String mShortPinYin;

    @NonNull
    @ColumnInfo(name = "latitude")
    private String mLatitude;

    @NonNull
    @ColumnInfo(name = "longtitude")
    private String mLongtitude;

    public Area(int id, @NonNull String code, @NonNull String province, @NonNull String city, @NonNull String country, @NonNull String fullPinYin,
                @NonNull String shortPinYin, @NonNull String latitude, @NonNull String longtitude) {
        mId = id;
        mCode = code;
        mProvince = province;
        mCity = city;
        mCountry = country;
        mFullPinYin = fullPinYin;
        mShortPinYin = shortPinYin;
        mLatitude = latitude;
        mLongtitude = longtitude;
    }

    public int getId() {
        return mId;
    }

    public Area setId(int id) {
        this.mId = id;
        return this;
    }

    @NonNull
    public String getCode() {
        return mCode == null ? "" : mCode;
    }

    public Area setCode(@NonNull String code) {
        this.mCode = code;
        return this;
    }

    public String getProvince() {
        return mProvince == null ? "" : mProvince;
    }

    public Area setProvince(String province) {
        this.mProvince = province;
        return this;
    }

    public String getCity() {
        return mCity == null ? "" : mCity;
    }

    public Area setCity(String city) {
        this.mCity = city;
        return this;
    }

    public String getCountry() {
        return mCountry == null ? "" : mCountry;
    }

    public Area setCountry(String country) {
        this.mCountry = country;
        return this;
    }

    public String getFullPinYin() {
        return mFullPinYin == null ? "" : mFullPinYin;
    }

    public Area setFullPinYin(String fullPinYin) {
        this.mFullPinYin = fullPinYin;
        return this;
    }

    public String getShortPinYin() {
        return mShortPinYin == null ? "" : mShortPinYin;
    }

    public Area setShortPinYin(String shortPinYin) {
        this.mShortPinYin = shortPinYin;
        return this;
    }

    public String getLatitude() {
        return mLatitude == null ? "" : mLatitude;
    }

    public Area setLatitude(String latitude) {
        mLatitude = latitude;
        return this;
    }

    public String getLongtitude() {
        return mLongtitude == null ? "" : mLongtitude;
    }

    public Area setLongtitude(String longtitude) {
        mLongtitude = longtitude;
        return this;
    }

    @Override
    public String toString() {
        return "Area{" +
                "mId=" + mId +
                ", mCode='" + mCode + '\'' +
                ", mProvince='" + mProvince + '\'' +
                ", mCity='" + mCity + '\'' +
                ", mCountry='" + mCountry + '\'' +
                ", mFullPinYin='" + mFullPinYin + '\'' +
                ", mShortPinYin='" + mShortPinYin + '\'' +
                ", mLatitude='" + mLatitude + '\'' +
                ", mLongtitude='" + mLongtitude + '\'' +
                '}';
    }
}